Skip to content

Conversation

@dimitri-yatsenko
Copy link
Member

@dimitri-yatsenko dimitri-yatsenko commented Jan 12, 2026

Summary

  • Raw blobs (no codec) now show bytes
  • Codec blobs show <codec_name> (e.g., <blob>, <object>)
  • Improves clarity when viewing table contents

Before

*id    data
1      =BLOB=

After

*id    raw_data  array_data
1      bytes     <blob>

Test plan

  • Manual test with raw blob and codec blob attributes
  • Run integration tests (requires Docker)

🤖 Generated with Claude Code

@github-actions github-actions bot added the enhancement Indicates new improvements label Jan 12, 2026
@dimitri-yatsenko dimitri-yatsenko force-pushed the enhance/blob-preview-display branch from e8b598b to ee2240b Compare January 12, 2026 00:31
@dimitri-yatsenko dimitri-yatsenko self-assigned this Jan 12, 2026
@dimitri-yatsenko dimitri-yatsenko marked this pull request as draft January 12, 2026 00:39
- Raw blobs (no codec) now show "bytes"
- Raw json (no codec) shows "json"
- Codec fields show "<codec_name>" (e.g., <blob>, <hash>, <object>)
- HTML output properly escapes angle brackets for browser display
- Improves clarity when viewing table contents

Example output:
  *id    raw_blob  blob_data  json_data
  1      bytes     <blob>     json

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@dimitri-yatsenko dimitri-yatsenko force-pushed the enhance/blob-preview-display branch from ee2240b to 7825b3c Compare January 12, 2026 00:51
@dimitri-yatsenko dimitri-yatsenko marked this pull request as ready for review January 12, 2026 19:01
@dimitri-yatsenko dimitri-yatsenko added this to the DataJoint 2.0 milestone Jan 12, 2026
Comment on lines +30 to +31
if attr is None:
return "bytes"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we expect attr to be None? Can it ever be None? If it can, perhaps this should raise an error instead of returning bytes

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! You're right - attr should never be None here since field_name always comes from heading.names. The defensive check was silently hiding potential bugs.

I've updated the code in PR #1331 (which now includes this PR) to raise an error instead:

if attr is None:
    raise DataJointError(f"Field '{field_name}' not found in heading")

This way any unexpected state will surface immediately rather than returning a misleading "bytes" placeholder.

dimitri-yatsenko added a commit that referenced this pull request Jan 12, 2026
Merge PR #1330 (blob preview display) into feature/npy-codec.
Bump version from 2.0.0a17 to 2.0.0a18.

Co-Authored-By: Claude Opus 4.5 <[email protected]>
dimitri-yatsenko added a commit that referenced this pull request Jan 12, 2026
Address reviewer feedback from PR #1330: attr should never be None
since field_name comes from heading.names. Raising an error surfaces
bugs immediately rather than silently returning a misleading placeholder.

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@dimitri-yatsenko dimitri-yatsenko merged commit 4f6625b into pre/v2.0 Jan 12, 2026
7 of 8 checks passed
@dimitri-yatsenko dimitri-yatsenko deleted the enhance/blob-preview-display branch January 12, 2026 23:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Indicates new improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants